<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:composite="http://java.sun.com/jsf/composite"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

<composite:interface>
	<composite:attribute name="comments" />
</composite:interface>

<composite:implementation>
	<p:panelGrid id="#{cc.id}" rendered="#{cc.rendered}">
		<p:row rendered="#{empty cc.attrs.comments}">
			<p:column>
				<h:outputText>No existe ningun comentario</h:outputText>
			</p:column>
		</p:row>
		<c:forEach var="comment" items="#{cc.attrs.comments}">
			<p:row>
				<p:column>
					<h:outputText value="#{comment.author}" style="font-weight: bold;"></h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{comment.comment}"></h:outputText>
				</p:column>
				<p:column>
					<h:outputText value="#{comment.time}" style="font-style: italic;">
						<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
					</h:outputText>
				</p:column>
			</p:row>
		</c:forEach>
	</p:panelGrid>
</composite:implementation>

</html>